﻿using System;
using System.Net.Sockets;
using JetBlack.IO;

namespace JetBlack.Net.Sockets
{
    internal class BlockingWriter
    {
        public readonly Socket Socket;

        public BlockingWriter(Socket socket)
        {
            Socket = socket;
        }

        public void Write(byte[] buffer)
        {
            Socket.Send(NetworkBitConverter.GetBytes(buffer.Length));
            Socket.Send(buffer);
        }
    }
}
